package com.bieyang.anjia.module;

/**
 * 设备类型
 * 
 * @author 余波
 * 
 */
public enum LoginTypeEnum {
	/** 主机 */
	MAIN("M", "主机"),
	/** 女 */
	CLIENT("C", "忠机");

	/** 枚举码. */
	private final String code;

	/** 描述信息. */
	private final String desc;

	/**
	 * 构造函数
	 * 
	 * @param code
	 * @param desp
	 */
	private LoginTypeEnum(String code, String desp) {
		this.code = code;
		this.desc = desp;
	}

	/**
	 * Getter method for property <tt>code</tt>.
	 * 
	 * @return property value of code
	 */
	public String getCode() {
		return code;
	}

	/**
	 * Getter method for property <tt>desc</tt>.
	 * 
	 * @return property value of desc
	 */
	public String getDesc() {
		return desc;
	}

	public static LoginTypeEnum getStatus(String code) {
		for (LoginTypeEnum status : LoginTypeEnum.values()) {
			if (status.getCode().equals(code)) {
				return status;
			}
		}
		return null;
	}
}
